package cn.ekgc.system.config;

import cn.ekgc.common.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class WebConfig extends WebMvcConfigurationSupport {

    public WebConfig(){
        System.out.println("调用成功");
    }


    @Autowired
    private LoginInterceptor logininterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(logininterceptor).addPathPatterns("/**")
                .excludePathPatterns("/login","/logout","/login1");
    }
}